package com.ibuonline.b2b.search.service;

import com.dimeng.common.base.BaseServiceImpl;
import com.ibuonline.b2b.entity.SearchWord;
import com.ibuonline.b2b.search.dao.SearchWordDAO;

import java.util.List;

/**
 *
 * @author wanghai
 */
public class SearchWordServiceImpl extends BaseServiceImpl<SearchWord> implements SearchWordService {

    @Override
    public int getRecordCountBySQL(String sql) {
        return ((SearchWordDAO) dao).getRecordCountBySQL(sql);
    }

    @Override
    public List<SearchWord> searchSearchWord(String word, int start, int size) {
        String hql = "from SearchWord sw where sw.word like ?";
        return dao.query(hql, "%" + word + "%", start, size);
    }
}
